/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */

package yuhuibear.poat.exception;

import java.util.LinkedList;

/**
 * 
 * @author yuhuibear
 */
@SuppressWarnings("serial")
public class PoatException extends Exception {

	public PoatException(Throwable cause) {
		super(cause);
	}

	public PoatException(String message, Throwable cause) {
		super(message, cause);
	}

	public PoatException(String message) {
		super(message);
	}

	protected void pushStackTraceElement(StackTraceElement track) {
		LinkedList<StackTraceElement> lst = new LinkedList<StackTraceElement>();
		for (StackTraceElement st : this.getStackTrace())
			lst.add(st);
		lst.addFirst(track);
		this.setStackTrace(lst.toArray(new StackTraceElement[0]));
		lst = null;
	}
}
